﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;

namespace SPCoder.Utils.Nodes
{
    public class BaseNode
    {
        public BaseNode()
        {
            Children = new List<BaseNode>();
        }
        public string Title { get; set; }

        public virtual string IconPath { get; set; }

        public string Url { get; set; }

        public Bitmap IconObject { get; set; }

        protected object _spObject;

        public object SPObject
        {
            get
            {
                if (_spObject == null)
                {
                    _spObject = GetRealSPObject();
                }
                return _spObject;
            }
            set
            {
                _spObject = value;
            }
        }

        public string SPObjectType { get; set; }

        public BaseNode ParentNode { get; set; }
        public IList<BaseNode> Children { get; set; }

        public BaseNode RootNode { get; set; }

        public ObjectModelType OMType { get; set; }

        public virtual object GetRealSPObject()
        {
            return null;
        }
    }
}
